﻿using Domain.Entities.Customers;
using FluentMigrator;
using FrameworkCore.Extensions;

namespace Domain.Migrations.Customers;

[Migration(202412262018)]
public class CustomerAddColumn : ForwardOnlyMigration
{
    public override void Up()
    {
        Alter.Table(MigrationExpressions.GetTableName(typeof(Customer)))
            .AddColumn(MigrationExpressions.ColumnNameFor<Customer>(nameof(Customer.Avatar))).AsString(500).Nullable().WithColumnDescription("头像")
            .AddColumn(MigrationExpressions.ColumnNameFor<Customer>(nameof(Customer.Username))).AsString(36).Nullable().WithColumnDescription("账号")
            .AddColumn(MigrationExpressions.ColumnNameFor<Customer>(nameof(Customer.PasswordHash))).AsString(36).Nullable().WithColumnDescription("哈希密码")
            .AddColumn(MigrationExpressions.ColumnNameFor<Customer>(nameof(Customer.Email))).AsString(255).Nullable().WithColumnDescription("邮箱地址");
    }
}
